home *** CD-ROM | disk | FTP | other *** search
/ Champak 109 / Vol 109.iso / games / race_gam.swf / scripts / DefineSprite_102 / frame_3 / DoAction.as
Encoding:
Text File  |  2008-11-12  |  8.1 KB  |  279 lines

  1. var ┬º\x01┬º = 240;
  2. while(true)
  3. {
  4.    if(eval("\x01") == 240)
  5.    {
  6.       set("\x01",eval("\x01") + 384);
  7.       ┬º┬ºpush(true);
  8.    }
  9.    else if(eval("\x01") == 400)
  10.    {
  11.       set("\x01",eval("\x01") - 257);
  12.       if(┬º┬ºpop())
  13.       {
  14.          set("\x01",eval("\x01") + 218);
  15.       }
  16.    }
  17.    else if(eval("\x01") == 478)
  18.    {
  19.       set("\x01",eval("\x01") - 78);
  20.       ┬º┬ºpush(true);
  21.    }
  22.    else
  23.    {
  24.       if(eval("\x01") == 256)
  25.       {
  26.          set("\x01",eval("\x01") + 459);
  27.          nextFrame();
  28.          ┬º┬ºpush(┬º┬ºpop() > ┬º┬ºpop());
  29.          break;
  30.       }
  31.       if(eval("\x01") == 361)
  32.       {
  33.          set("\x01",eval("\x01") + 16);
  34.          ┬º┬ºpush(true);
  35.       }
  36.       else
  37.       {
  38.          if(eval("\x01") == 143)
  39.          {
  40.             set("\x01",eval("\x01") + 218);
  41.             break;
  42.          }
  43.          if(eval("\x01") == 815)
  44.          {
  45.             set("\x01",eval("\x01") - 337);
  46.             break;
  47.          }
  48.          if(eval("\x01") == 624)
  49.          {
  50.             set("\x01",eval("\x01") - 368);
  51.             if(┬º┬ºpop())
  52.             {
  53.                set("\x01",eval("\x01") + 459);
  54.             }
  55.          }
  56.          else if(eval("\x01") == 377)
  57.          {
  58.             set("\x01",eval("\x01") + 12);
  59.             if(┬º┬ºpop())
  60.             {
  61.                set("\x01",eval("\x01") + 514);
  62.             }
  63.          }
  64.          else if(eval("\x01") == 597)
  65.          {
  66.             set("\x01",eval("\x01") + 196);
  67.             if(┬º┬ºpop())
  68.             {
  69.                set("\x01",eval("\x01") - 312);
  70.             }
  71.          }
  72.          else if(eval("\x01") == 481)
  73.          {
  74.             set("\x01",eval("\x01") + 318);
  75.             ┬º┬ºpush(true);
  76.          }
  77.          else if(eval("\x01") == 611)
  78.          {
  79.             set("\x01",eval("\x01") + 204);
  80.             if(┬º┬ºpop())
  81.             {
  82.                set("\x01",eval("\x01") - 337);
  83.             }
  84.          }
  85.          else if(eval("\x01") == 715)
  86.          {
  87.             set("\x01",eval("\x01") - 273);
  88.             ┬º┬ºpush(true);
  89.          }
  90.          else
  91.          {
  92.             if(eval("\x01") == 389)
  93.             {
  94.                set("\x01",eval("\x01") + 514);
  95.                break;
  96.             }
  97.             if(eval("\x01") == 903)
  98.             {
  99.                set("\x01",eval("\x01") + 9);
  100.                ┬º┬ºpush(true);
  101.             }
  102.             else if(eval("\x01") == 75)
  103.             {
  104.                set("\x01",eval("\x01") + 536);
  105.                ┬º┬ºpush(true);
  106.             }
  107.             else
  108.             {
  109.                if(eval("\x01") == 727)
  110.                {
  111.                   set("\x01",eval("\x01") - 652);
  112.                   break;
  113.                }
  114.                if(eval("\x01") == 442)
  115.                {
  116.                   set("\x01",eval("\x01") - 200);
  117.                   if(┬º┬ºpop())
  118.                   {
  119.                      set("\x01",eval("\x01") + 16);
  120.                   }
  121.                }
  122.                else if(eval("\x01") == 912)
  123.                {
  124.                   set("\x01",eval("\x01") - 633);
  125.                   if(┬º┬ºpop())
  126.                   {
  127.                      set("\x01",eval("\x01") + 231);
  128.                   }
  129.                }
  130.                else
  131.                {
  132.                   if(eval("\x01") == 279)
  133.                   {
  134.                      set("\x01",eval("\x01") + 231);
  135.                      break;
  136.                   }
  137.                   if(eval("\x01") == 242)
  138.                   {
  139.                      set("\x01",eval("\x01") + 16);
  140.                      break;
  141.                   }
  142.                   if(eval("\x01") == 510)
  143.                   {
  144.                      set("\x01",eval("\x01") + 396);
  145.                      rt = new Array(100);
  146.                      i = 0;
  147.                      while(i < celmax)
  148.                      {
  149.                         rt[i] = -1;
  150.                         i++;
  151.                      }
  152.                      c = 0;
  153.                      slist = new Array(celmax);
  154.                      i = 0;
  155.                      while(i < celmax)
  156.                      {
  157.                         if(imap[i] == 2)
  158.                         {
  159.                            slist[c] = i;
  160.                            c++;
  161.                         }
  162.                         i++;
  163.                      }
  164.                      if(c == 0)
  165.                      {
  166.                         trace("error");
  167.                      }
  168.                      celnum = c;
  169.                      r = Math.floor(Math.random() * c);
  170.                      ox = Math.floor(slist[r] % xmax);
  171.                      oy = Math.floor(slist[r] / xmax);
  172.                      rn = 0;
  173.                      start_rn = -1;
  174.                      old_dir = -1;
  175.                      while(true)
  176.                      {
  177.                         cn = oy * xmax + ox;
  178.                         rt[rn] = cn;
  179.                         imap[cn] = 0;
  180.                         dir = -1;
  181.                         k = 0;
  182.                         while(k < 4)
  183.                         {
  184.                            x = ox + xadd[k];
  185.                            y = oy + yadd[k];
  186.                            if(imap[y * xmax + x] == 2)
  187.                            {
  188.                               nx = x;
  189.                               ny = y;
  190.                               dir = k;
  191.                            }
  192.                            k++;
  193.                         }
  194.                         if(dir < 0)
  195.                         {
  196.                            break;
  197.                         }
  198.                         if(dir == old_dir)
  199.                         {
  200.                            dir_cnt++;
  201.                            if(dir_cnt >= 3)
  202.                            {
  203.                               start_rn = rn;
  204.                            }
  205.                         }
  206.                         else
  207.                         {
  208.                            dir_cnt = 0;
  209.                            old_dir = dir;
  210.                         }
  211.                         rn++;
  212.                         if(rn >= 100)
  213.                         {
  214.                            break;
  215.                         }
  216.                         ox = nx;
  217.                         oy = ny;
  218.                      }
  219.                      if(start_rn < 0 || celnum >= 50)
  220.                      {
  221.                         gotoAndStop("map");
  222.                         play();
  223.                      }
  224.                      else
  225.                      {
  226.                         route = new Array(100);
  227.                         i = 0;
  228.                         while(i < 100)
  229.                         {
  230.                            route[i] = -1;
  231.                            i++;
  232.                         }
  233.                         n = start_rn;
  234.                         i = 0;
  235.                         while(i < 100)
  236.                         {
  237.                            route[i] = rt[n];
  238.                            n++;
  239.                            if(rt[n] < 0)
  240.                            {
  241.                               n = 0;
  242.                            }
  243.                            if(n == start_rn)
  244.                            {
  245.                               break;
  246.                            }
  247.                            i++;
  248.                         }
  249.                      }
  250.                      break;
  251.                   }
  252.                   if(eval("\x01") == 258)
  253.                   {
  254.                      set("\x01",eval("\x01") + 339);
  255.                      ┬º┬ºpush(true);
  256.                   }
  257.                   else
  258.                   {
  259.                      if(eval("\x01") != 799)
  260.                      {
  261.                         if(eval("\x01") == 793)
  262.                         {
  263.                            set("\x01",eval("\x01") - 312);
  264.                         }
  265.                         break;
  266.                      }
  267.                      set("\x01",eval("\x01") - 72);
  268.                      if(┬º┬ºpop())
  269.                      {
  270.                         set("\x01",eval("\x01") - 652);
  271.                      }
  272.                   }
  273.                }
  274.             }
  275.          }
  276.       }
  277.    }
  278. }
  279.